<template>
    <div class='oneMain'>
       <h3 class='title'>{{ data.title }}</h3>
           <p class='eye'>
               <span>发表时间:{{ data.add_time | solveTime }}</span>
               <span>点击{{ data.click }}次</span>
           </p>
           <hr>
           <div v-html="data.content"></div>  

           <comment :sonid='id'></comment>
       </div>
       
    
</template>

<script>
import comment from '../comment.vue'
import { Toast } from 'mint-ui';
    export default{
        data () {
            return {
                id:this.$route.params.id,
                data:{}
            }
        },
        created() {
           this.showdata()
        },
        methods: {
            showdata(){
                   this.$http.get('api/getnew/'+this.id).then(result=>{
                       if(result.body.status===0){
                            this.data=result.body.message[0]  
                       }else{
                           Toast('获取新闻详情失败')
                       }
                                
                   })
            }
        },
        components:{
            comment
        }
    }
</script>

<style lang="less" scoped  >
.oneMain{
    padding: 0 4px;
    .title{
        text-align: center;
        color: red;
        font-size: 16px;
        font-weight: 900;
        padding-top: 15px;}
        .eye{
            padding-top:15px;
            display: flex;
            justify-content: space-between;
            span{
              font-size: 14px;
              color: #9199fd
            }
        }
    }

</style>
